package com.fz.us.admin.base.bean.search.projection;

import com.fz.us.admin.base.bean.search.SearchEnum;
import org.springframework.util.Assert;

/**
 * 查询 - 参数 - ProjectionRowCount
 * ============================================================================
 * 版权所有 2016 。
 *
 * @author fallenpanda
 * @version 1.0 2016-07-13 。
 * ============================================================================
 */
public class ProjectionRowCount extends Projection {

    private ProjectionRowCount(SearchEnum.ProjectionType projectionType) {
        super(projectionType);
    }

    public static ProjectionRowCount rowCount() {
        return newBuilder().setProjectionType(SearchEnum.ProjectionType.rowCount).build();
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public static class Builder extends Projection.Builder<Projection, Builder> {

        @Override
        protected Builder getThis() {
            return this;
        }

        @Override
        public ProjectionRowCount build() {
            Assert.notNull(projectionType, "projectionType 不能为空");
            return new ProjectionRowCount(projectionType);
        }

    }

}
